package adventure.commands;

import adventure.*;
import player.*;

/**
 *
 * @author Michael Hanns
 *
 */
public class SetDescription extends AbstractCommand {

    public SetDescription(Adventure a) {
        super(a, new String[] {"DESCRIPTION", "SETDESCRIPTION"});
    }

    @Override
    public String validateAndExecute(Player p, String[] args) {
        if (args.length == 1) {
            return "Set your description to what?";
        } else {
            String desc = Util.consolidateArguments(args);
            ((PlayerEdit) p).setDescription(desc);

            return "Your description has been set to:\n" + desc;
        }
    }
}
